"""xfz URL Configuration

The `urlpatterns` list routes URLs to views. For more information please see:
    https://docs.djangoproject.com/en/2.2/topics/http/urls/
Examples:
Function views
    1. Add an import:  from my_app import views
    2. Add a URL to urlpatterns:  path('', views.home, name='home')
Class-based views
    1. Add an import:  from other_app.views import Home
    2. Add a URL to urlpatterns:  path('', Home.as_view(), name='home')
Including another URLconf
    1. Import the include() function: from django.urls import include, path
    2. Add a URL to urlpatterns:  path('blog/', include('blog.urls'))
"""

from django.urls import path, include
from apps.news import views
from django.conf.urls.static import static
from django.conf import settings

urlpatterns = [
    #请求首页以后，交由那个试图函数处理
    path('', views.index,name='index'),
    #请求搜索界面视图处理
    path('search/', views.search, name='search'),
    #与新闻相关的请求的视图处理
    path('news/', include("apps.news.urls")),
    #与后台相关的请求的视图处理
    path('cms/', include("apps.cms.urls")),
    #处理与账户相关的请求，登录/注册
    path('account/', include("apps.xfzauth.urls")),
    #处理与课程相关的请求
    path('course/', include("apps.course.urls")),
    #处理与支付相关的请求
    path('payinfo/', include("apps.payinfo.urls")),
    path('ueditor/', include("apps.ueditor.urls")),
] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)

if settings.DEBUG:
    import debug_toolbar
    urlpatterns.append(path("__debug__/", include(debug_toolbar.urls)))